﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true"
    CodeBehind="SearchResult.aspx.cs" Inherits="WebApplication1.SearchResult" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .class0
        {
            background: #FFCC80 url("images/x.gif") repeat-x;
            width: 0px;
            height: 17px;
        }
        .class1
        {
            /*background: #FFCC80 url("images/x.gif") repeat-x;
            width: 20px;*/
            background: #FFCC80 url("images/star1.jpg") no-repeat;
            width:86px;
            height: 17px;
        }
        .class2
        {
            /*background: #FFCC80 url("images/x.gif") repeat-x;
            width: 40px;*/
            background: #FFCC80 url("images/star2.jpg") no-repeat;
            width:86px;
            height: 17px;
        }
        .class3
        {
            /*background: #FFCC80 url("images/x.gif") repeat-x;
            width: 60px;*/
            background: #FFCC80 url("images/star3.jpg") no-repeat;
            width:86px;
            height: 17px;
        }
        .class4
        {
            /*background: #FFCC80 url("images/x.gif") repeat-x;
            width: 80px;*/
            background: #FFCC80 url("images/star4.jpg") no-repeat;
            width:86px;
            height: 17px;
        }
        .class5
        {
            /*background: #FFCC80 url("images/x.gif") repeat-x;
            width: 100px;*/
            background: #FFCC80 url("images/star5.jpg") no-repeat;
            width:86px;
            height: 17px;
        }
        #index_map
        {
            margin-left: 56px;
            height: 400px;
            width: 850px;
            background: #FFFFCC;
        }
    </style>
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
    <script type="text/javascript">

        function change(select) {
            var index = select.nextSibling.href.lastIndexOf("&TagId=");
            if (index != -1) {
                select.nextSibling.href = select.nextSibling.href.substring(0, index);
            }
            select.nextSibling.href += '&TagId=';
            select.nextSibling.href += select.value;
        }

        function addMarker1(point1, text, description) {
            var marker = new BMap.Marker(point1);
            map.addOverlay(marker);
            var label = new BMap.Label(text, { offset: new BMap.Size(20, -10) });
            marker.setLabel(label);

            var sContent =
            "<div><h4 style='margin:0 0 5px 0;padding:0.2em 0'>" + text + "</h4>" +
            "<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em;width:200px;'>" + description + "</p>" +
            "<select id='ui_element' onchange='change(this)'><option value='A' selected>-全部-</option><option value='3'>学前教育</option>" +
            "<option value='4'>小学教育</option><option value='5'>初中教育</option><option value='6'>高中教育</option>" +
            "<option value='7'>大学教育</option><option value='8'>专升本</option><option value='9'>留学</option><option value='10'>艺术</option></select>" +
            "<a class='tiaotiao' name='search' href='/SearchResult.aspx?Lo=" + point1.lng + "&La=" + point1.lat + "'>跳一跳</a>"
            "</div>";

            var infoWindow = new BMap.InfoWindow(sContent);  // 创建信息窗口对象
            marker.addEventListener("click", function () {
                this.openInfoWindow(infoWindow);
                //图片加载完毕重绘infowindow
            });

        }

        $(document).ready(function () {

            $(".item").mousemove(function () {
                $(this).find(".pjb").show();
            });

            $(".item").mouseout(function () {
                $(this).find(".pjb").hide();
            });


            $("#MainContent_ibViewMap").click(function () {

                var jsonconf = $.parseJSON($("#HiddenField1").val());
                var points = [];
                map.clearOverlays();
                //alert(jsonconf.length);
                for (var i = 0; i < jsonconf.length; i++) {
                    addMarker1(new BMap.Point(jsonconf[i].Longitude, jsonconf[i].Latitude), jsonconf[i].Name, jsonconf[i].Description);
                    points.push(new BMap.Point(jsonconf[i].Longitude, jsonconf[i].Latitude));
                }

                if ($("#index_map").is(":hidden"))
                    $("#index_map").slideToggle(500); //窗帘效果的切换,点一下收,点一下开,参数可以无,参数说明同上
                //map.centerAndZoom(points[0], 15);                  // 初始化地图,设置中心点坐标和地图级别。
                map.setViewport(points);
                return false;
            });
        });

        
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="main">
        <div id="s_bodya">
            <span>
                <div style="float: left;">
                    <asp:TextBox ID="tbxSearch" CssClass="search_input" Text="输入您的地址或所在学校" runat="server"></asp:TextBox>
                </div>
            </span><span class="inputb">
                <asp:ImageButton ID="ibSearch" ImageUrl="images/s003.gif" runat="server" ClientIDMode="Static"
                    OnClick="btnSearch_Click" /></span>
            <div class="c">
            </div>
        </div>
        <div style="clear: both;">
        </div>
    </div>
    <div class="main">

            <div class="list">
<div class="title">小学教育</div>
<div class="c fllist">
<asp:Repeater ID="rptMenu1" runat="server">
                    <HeaderTemplate>
                       <ul>
                    </HeaderTemplate>
                    <ItemTemplate>
                    <li>
                        <asp:LinkButton ID="lbtMenu1" runat="server" OnCommand="lbTag1Click" CommandArgument='<%#Eval("Id") %>'><%#Eval("TagName") %> </asp:LinkButton>
                    </li>
                    </ItemTemplate>
                    <FooterTemplate>
                    </ul>
                    </FooterTemplate>
                </asp:Repeater>
<div class="c"></div>
</div>
<div class="c fllistb" id="secondDiv" runat="server" style="display:none">
<asp:Repeater ID="rptMenu2" runat="server">
                    <HeaderTemplate>
                       <ul>
                    </HeaderTemplate>
                    <ItemTemplate>
                    <li>
                        <asp:LinkButton ID="lbtMenu2" runat="server" OnCommand="lbTag2Click" CommandArgument='<%#Eval("Id") %>'><%#Eval("TagName") %> </asp:LinkButton>
                    </li>
                    </ItemTemplate>
                    <FooterTemplate>
                    </ul>
                    </FooterTemplate>
                    
                </asp:Repeater>
<div class="c"></div>
<div class="c fllistc" id="thirdDiv" runat="server" style="display:none">
<asp:Repeater ID="rptMenu3" runat="server">
                    <HeaderTemplate>
                        <ul>
                    </HeaderTemplate>
                    <ItemTemplate>
                    <li>
                        <asp:LinkButton ID="lbtMenu3" runat="server" OnCommand="lbTag3Click" CommandArgument='<%#Eval("Id") %>'><%#Eval("TagName") %> </asp:LinkButton>
                   </li>
                    </ItemTemplate>
                    <FooterTemplate></ul></FooterTemplate>
                </asp:Repeater>
<div class="c"></div></div>
</div>
</div>


            <div class="list c height30">
                <div class="title">
                    排序</div>
                <div class="pxa">
                    <asp:LinkButton ID="DistanceLinkBtn" runat="server" OnClick="DistanceLinkBtn_Click"><img src="images/002.gif" border="0" /></asp:LinkButton>
                    <asp:LinkButton ID="PopularityLinkBtn" runat="server" OnClick="PopularityLinkBtn_Click"><img src="images/003.gif" border="0" /></asp:LinkButton>
                    <asp:LinkButton ID="StarLevelLinkBtn" runat="server" OnClick="StarLevelLinkBtn_Click"><img src="images/004.gif" border="0" /></asp:LinkButton>
                </div>
                <div class="pxb">
                    <asp:ImageButton ID="ibViewMap" runat="server" ImageUrl="images/005.gif" />
                </div>
                <div class="c" id="index_map" style="display: none;">
                    地图插入这里</div>
                <script type="text/javascript">
                    var map = new BMap.Map("index_map");          // 创建Map实例
                    var point = new BMap.Point(116.404, 39.915);  // 创建点坐标
                    map.centerAndZoom(point, 15);                  // 初始化地图,设置中心点坐标和地图级别。
                    map.enableScrollWheelZoom();                  // 启用滚轮放大缩小。
                    map.enableKeyboard();                         // 启用键盘操作。
                    map.addControl(new BMap.NavigationControl());               // 添加平移缩放控件
                    map.addControl(new BMap.ScaleControl());                    // 添加比例尺控件
                    map.addControl(new BMap.OverviewMapControl());              //添加缩略地图控

                </script>
                <asp:Repeater ID="rptOrgnization" runat="server" OnItemDataBound="rptOrgnization_ItemDataBound">
                    <ItemTemplate>
                        <div class="line c item">
                            <div class="c fllist">
                                <div class="xx">
                                    <div class="title">
                                        <a href="ViewSchool.aspx?SchoolId=<%#Eval("Id") %>">
                                            <%#Eval("Name") %></a></div>
                                    <div class="hui c">
                                        地址:
                                        <%#Eval("Address") %></div>
                                    <div class="hui c">
                                        标签:<asp:Repeater ID="subrptTag" runat="server">
                                            <ItemTemplate>
                                                <%#Eval("TagName") %>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </div>
                                    <div class="pjb" style="display:none;">
                                        <a href="ViewSchool.aspx?SchoolId=<%#Eval("Id") %>">我要点评</a> |
                                        <asp:LinkButton ID="lbtCollect" runat="server" CommandName="AddFavourite" OnCommand="AddFavourite_Command"
                                            CommandArgument='<%#Eval("Id")%>'>我要收藏
                                        </asp:LinkButton>
                                        |<a href="ViewSchool.aspx?SchoolId=<%#Eval("Id") %>">
                                            <%#Eval("CommentCount") %>封点评</a>
                                    </div>
                                </div>
                                <div class="pja">
                                    <p>
                                        <span>总评</span> <span class="class<%#Eval("SL_Integrate") %>"></span>
                                    </p>
                                    <p>
                                        <span>质量</span> <span class="class<%#Eval("SL_Quality") %>"></span>
                                    </p>
                                    <p>
                                        <span>价格</span><span class="class<%#Eval("SL_Price") %>"> </span>
                                    </p>
                                    <p>
                                        <span>服务</span><span class="class<%#Eval("SL_Service") %>"> </span>
                                    </p>
                                    <p>
                                        <span>环境</span><span class="class<%#Eval("SL_Environment") %>"> </span>
                                    </p>
                                
                                </div>
                            </div>
                            <div class="c">
                            </div>
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
                <div class="fypage">
                    <asp:Label ID="lblCurrentPage" runat="server"></asp:Label>
                    <asp:HyperLink ID="lnkFrist" runat="server">首页</asp:HyperLink>
                    <asp:HyperLink ID="lnkPrev" runat="server">上一页</asp:HyperLink>
                    <asp:HyperLink ID="lnkNext" runat="server">下一页</asp:HyperLink>
                    <asp:HyperLink ID="lnkEnd" runat="server">尾页</asp:HyperLink>
                </div>
                 <div class="jiameng c">
            <div>
                没有找到想要的商户，请</div>
            <div>
                <div>
                <asp:ImageButton ID="ibAdd" runat="server" ImageUrl="images/007.gif" 
                        onclick="ibAdd_Click" />
                </div>
                机构名称：
                <asp:TextBox ID="TextBox_Name" runat="server"></asp:TextBox>
                机构地址：
                <asp:TextBox ID="TextBox_Address"
                    runat="server"></asp:TextBox>
                </div>
        </div>

            </div>
        <asp:HiddenField ID="HiddenField1" runat="server" ClientIDMode="Static" />
    </div>
</asp:Content>
